package com.example.liu_zi_qi

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }
    }

    /**
     * 人机对战
     */
    fun onProfile(view: View){
        Toast.makeText(this,"正在进入游戏简介", Toast.LENGTH_SHORT).show()
        val intent= Intent()
        intent.setClass(this,ProfileActivity::class.java)
        startActivity(intent)
    }

    /**
     * 双人PK
     */
    fun onTwo(view: View){
        Toast.makeText(this,"正在进入双人对战", Toast.LENGTH_SHORT).show()
        val intent= Intent()
        intent.setClass(this,GameActivity::class.java)
        intent.putExtra("model",GameModel.TWO)
        startActivity(intent)
    }



}